﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Morus;

namespace KAKA
{
    public class AuthenticationAttribute : System.Web.Mvc.AuthorizeAttribute, IAuthorizationFilter
    {
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            if (httpContext.Request.IsAuthenticated && httpContext.User.Identity.Name.IsNotEmpty())
            {
                return IoC.Resolve<IFormsAuthentication>().IsAuthenticated;
            }
            return false;
        }
    }
}